﻿//倾斜服务
var tileset = null;
function ObliqueService(layerInfo) {
    var ObliqueService = new Object;
    ObliqueService.id = layerInfo.hasOwnProperty("GUID") ? layerInfo.GUID : "";
    ObliqueService.url = layerInfo.hasOwnProperty("URL") ? layerInfo.URL.replace("http://:", "http://") : "";
    ObliqueService.name = layerInfo.hasOwnProperty("NAME") ? layerInfo.NAME : "";
    ObliqueService.servertype = layerInfo.hasOwnProperty("SERVERTYPE") ? layerInfo.SERVERTYPE : "";
    ObliqueService.CreateLayer = function () {
        var url = this.url.replace("http://http://","http://");
        var id = this.id;
        var name = this.name;
        var thisLayer = null;
        //加载倾斜摄影
        var tileset = new Cesium.Cesium3DTileset({
            //相对路径
            url: url,
            skipLevelOfDetail : true
        });
        //添加到球体上
        var thisLayer = viewer.scene.primitives.add(tileset);
        return thisLayer;
    }
    return ObliqueService;
}